package com.youyi.flymewallpager.decoration;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by xzp on 16/5/11.
 */
public class OffsetItemDecoration extends RecyclerView.ItemDecoration{
    private Rect mOutRect;

    public OffsetItemDecoration(int left,int top,int right,int bottom) {
        mOutRect=new Rect();
        mOutRect.left=left;
        mOutRect.right=right;
        mOutRect.top=top;
        mOutRect.bottom=bottom;
    }

    public Rect getOutRect() {
        return mOutRect;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        outRect.left=mOutRect.left;
        outRect.top=mOutRect.top;
        outRect.right=mOutRect.right;
        outRect.bottom=mOutRect.bottom;
    }
}
